/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package impss;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Mikehood
 */
@Entity
@Table(name = "af", catalog = "impss", schema = "")
@NamedQueries({@NamedQuery(name = "Af.findAll", query = "SELECT a FROM Af a"), @NamedQuery(name = "Af.findByAfID", query = "SELECT a FROM Af a WHERE a.afID = :afID"), @NamedQuery(name = "Af.findByAfName", query = "SELECT a FROM Af a WHERE a.afName = :afName")})
public class Af implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "afID")
    private Integer afID;
    @Column(name = "afName")
    private String afName;

    public Af() {
    }

    public Af(Integer afID) {
        this.afID = afID;
    }

    public Integer getAfID() {
        return afID;
    }

    public void setAfID(Integer afID) {
        Integer oldAfID = this.afID;
        this.afID = afID;
        changeSupport.firePropertyChange("afID", oldAfID, afID);
    }

    public String getAfName() {
        return afName;
    }

    public void setAfName(String afName) {
        String oldAfName = this.afName;
        this.afName = afName;
        changeSupport.firePropertyChange("afName", oldAfName, afName);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (afID != null ? afID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Af)) {
            return false;
        }
        Af other = (Af) object;
        if ((this.afID == null && other.afID != null) || (this.afID != null && !this.afID.equals(other.afID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "impss.Af[afID=" + afID + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
